package org.jpass.dc.common.email;

public class SendEmail {

	/** 发送激活邮件 **/
	public void sendEmail(String emailFlag,String httpPath, String rootPath, String username,
			String email, String sendEmailTime) {

		MailSenderInfo mailInfo = new MailSenderInfo(); // 设置邮件
		mailInfo.setMailServerHost("smtp.qq.com");
		mailInfo.setMailServerPort("25");
		mailInfo.setValidate(true); // 需要身份认证
		mailInfo.setUserName("491284728@qq.com"); // 发送邮箱账号
		mailInfo.setPassword("lanjie+091112"); // 发送邮箱密码
		mailInfo.setFromAddress("491284728@qq.com");
		mailInfo.setToAddress(email);
		//mailInfo.setToAddress("290707315@qq.com");
		if ("register".equals(emailFlag)) {
			mailInfo.setSubject("PAAS平台账户激活邮件");
		} else if ("forgetPass".equals(emailFlag)) {
			mailInfo.setSubject("PAAS平台找回密码邮件");
		}
		String content = new GenerateVelocityMail().getContent(emailFlag,httpPath,
				rootPath, username, sendEmailTime);// 得到邮件模板内容
		mailInfo.setContent(content);
		SimpleMailSender sms = new SimpleMailSender();
		sms.sendHtmlMail(mailInfo);// 发送html格式
	}

}
